package com.cyj.springioc3.main;

import com.cyj.springioc3.mapper.IUserMapper;
import com.cyj.springioc3.service.IUserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @description:
 * @Author C_Y_J
 * @create 2021-02-24 15:44
 **/
public class UserDemo {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
//        System.out.println("===");
        IUserService userService1 = (IUserService) applicationContext.getBean("userService");
//        IUserService userService2 = (IUserService) applicationContext.getBean("userService");
//        System.out.println(userService1.equals(userService2));
//        System.out.println(userService1 + "\n" +
//                "比较两个的地址值是否相等" + "\n" +
//                userService2);
//        IUserMapper userMapper1 = (IUserMapper) applicationContext.getBean("mapper");
//        IUserMapper userMapper2 = (IUserMapper) applicationContext.getBean("mapper");
//        System.out.println(userMapper1.equals(userMapper2));
//        System.out.println(userMapper1 + "\n" +
//                "比较两个的地址值是否相等" + "\n" +
//                userMapper2);
        userService1.save();
    }
}
